if (isDedicated) exitWith{};

waituntil {!(isnull player)};

////////////////////////////////////////////////////////////
// Respawn Handling
////////////////////////////////////////////////////////////

player switchmove "";
player setskill 0;
{player disableAI _x} foreach ["move","anim","target","autotarget"];
player setVariable ["BIS_noCoreConversations", true];

player addRating -(rating player);

if (markerType "TeamSpeakMarker" != "" && {(localize "STR_TeamSpeakMarker") != ""}) then {
	private "_marker";
	_marker = createMarkerLocal ["TeamSpeakMarkerLocal", markerPos "TeamSpeakMarker"];
	_marker setMarkerColorLocal "ColorBlufor";
	_marker setMarkerShapeLocal "ICON";
	_marker setMarkerTypeLocal "mil_warning";
	_marker setMarkerSizeLocal [0.6,0.6];
	_marker setMarkerTextLocal (localize "STR_TeamSpeakMarker");
};

if (markerType "WebsiteMarker" != "" && {(localize "STR_WebsiteMarker") != ""}) then {
	private "_marker";
	_marker = createMarkerLocal ["WebsiteMarkerLocal", markerPos "WebsiteMarker"];
	_marker setMarkerColorLocal "ColorBlufor";
	_marker setMarkerShapeLocal "ICON";
	_marker setMarkerTypeLocal "mil_flag";
	_marker setMarkerSizeLocal [0.6,0.6];
	_marker setMarkerTextLocal (localize "STR_WebsiteMarker");
};

if (hasInterface) then {
	[Instructor, "how"] call IP_fnc_addConversation;
	Instructor setVariable ["IP_Avatar", "tmf\images\instructor.jpg"];

	if (!isNil "mp_rights_fnc_isMember") then {
		if (player call mp_rights_fnc_isMember) then {
			[player,"TeamInsigna"] call BIS_fnc_setUnitInsignia;
		};
	} else {
		[player,"TeamInsigna"] call BIS_fnc_setUnitInsignia;
	};
};